package com.sky.mapper;

import com.sky.entity.User;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select *from sky_take_out.user where openid = #{openid}")
    User selectByOpenId(String openid);

    /*
    * 插入新用户
     */
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into sky_take_out.user(openid,name,create_time) values (#{openid},#{name},#{createTime})")
    void insert(User user);
}
